import { competition, ResPage } from "@/api/interface/index";
import { PORT1 } from "@/api/config/servicePort";
import http from "@/api";

/**
 * @name 网络质量竞赛接口
 */

// 获取竞赛数据
export const getNetQualityIndicatorListApi = (params: any) => {
  return http.post<ResPage<any>>(PORT1 + `/competition/indicator_data`, params);
};

// 获取区县列表
export const getNetQualityDepartmentListApi = () => {
  return http.get<competition.ResDepartment>(PORT1 + `/competition/department_data`, {}, { loading: false });
};

// 获取excel导出数据
export const exportNetQualityInfoApi = (params: any) => {
  return http.download(PORT1 + `/competition/exportInfo`, params);
};

// 获取部门数据
export const getNetQualityTeamListApi = () => {
  return http.get<competition.ResTeams>(PORT1 + `/competition/get_team_list`, {}, { loading: false });
};

// 获取三级指标数据
export const getNetQualityThreeLevelApi = () => {
  return http.get<competition.ResThreeLevel>(PORT1 + `/competition/get_three_level`, {}, { loading: false });
};

/**
 * @name 固本强基竞赛接口
 */

// 获取固本强基竞赛数据
export const getGuBenQjIndicatorListApi = (params: any) => {
  return http.post<ResPage<any>>(PORT1 + `/gubenqj/indicator_data`, params);
};

// 获取固本强基区县列表
export const getGuBenQjDepartmentListApi = () => {
  return http.get<competition.ResDepartment>(PORT1 + `/gubenqj/department_data`, {}, { loading: false });
};

// 导出固本强基excel数据
export const exportGuBenQjInfoApi = (params: any) => {
  return http.download(PORT1 + `/gubenqj/exportInfo`, params);
};

// 获取固本强基部门数据
export const getGuBenQjTeamListApi = () => {
  return http.get<competition.ResTeams>(PORT1 + `/gubenqj/get_team_list`, {}, { loading: false });
};

// 获取固本强基三级指标数据
export const getGuBenQjThreeLevelApi = () => {
  return http.get<competition.ResThreeLevel>(PORT1 + `/gubenqj/get_three_level`, {}, { loading: false });
};

/**
 * @name 双百行动竞赛-家宽接口
 */

// 获取竞赛数据
export const getJiaKuAnIndicatorListApi = (params: any) => {
  return http.post<ResPage<any>>(PORT1 + `/jiakuan/indicator_data`, params);
};

// 获取区县列表
export const getJiaKuAnDepartmentListApi = () => {
  return http.get<competition.ResDepartment>(PORT1 + `/jiakuan/department_data`, {}, { loading: false });
};

// 获取excel导出数据
export const exportJiaKuAnInfoApi = (params: any) => {
  return http.download(PORT1 + `/jiakuan/exportInfo`, params);
};

// 获取部门数据
export const getJiaKuAnTeamListApi = () => {
  return http.get<competition.ResTeams>(PORT1 + `/jiakuan/get_team_list`, {}, { loading: false });
};

// 获取三级指标数据
export const getJiaKuAnThreeLevelApi = () => {
  return http.get<competition.ResThreeLevel>(PORT1 + `/jiakuan/get_three_level`, {}, { loading: false });
};

/**
 * @name 双百行动竞赛-集客接口
 */

// 获取竞赛数据
export const getJIKeIndicatorListApi = (params: any) => {
  return http.post<ResPage<any>>(PORT1 + `/jike/indicator_data`, params);
};

// 获取区县列表
export const getJIKeDepartmentListApi = () => {
  return http.get<competition.ResDepartment>(PORT1 + `/jike/department_data`, {}, { loading: false });
};

// 获取excel导出数据
export const exportJIKeInfoApi = (params: any) => {
  return http.download(PORT1 + `/jike/exportInfo`, params);
};

// 获取部门数据
export const getJIKeTeamListApi = () => {
  return http.get<competition.ResTeams>(PORT1 + `/jike/get_team_list`, {}, { loading: false });
};

// 获取三级指标数据
export const getJIKeThreeLevelApi = () => {
  return http.get<competition.ResThreeLevel>(PORT1 + `/jike/get_three_level`, {}, { loading: false });
};

/**
 * @name 无线网络质量竞赛接口
 */

// 获取竞赛数据
export const getWuXianIndicatorListApi = (params: any) => {
  return http.post<ResPage<any>>(PORT1 + `/wuxian/indicator_data`, params);
};

// 获取区县列表
export const getWuXianDepartmentListApi = () => {
  return http.get<competition.ResDepartment>(PORT1 + `/wuxian/department_data`, {}, { loading: false });
};

// 获取excel导出数据
export const exportWuXianInfoApi = (params: any) => {
  return http.download(PORT1 + `/wuxian/exportInfo`, params);
};

// 获取部门数据
export const getWuXianTeamListApi = () => {
  return http.get<competition.ResTeams>(PORT1 + `/wuxian/get_team_list`, {}, { loading: false });
};

// 获取三级指标数据
export const getWuXianThreeLevelApi = () => {
  return http.get<competition.ResThreeLevel>(PORT1 + `/wuxian/get_three_level`, {}, { loading: false });
};
